/*
 * @Author: szx
 * @Date: 2022-03-06 12:55:32
 * @LastEditTime: 2022-03-06 12:59:03
 * @Description:
 * @FilePath: \leetcode\6000-6100\6016\6016.js
 */
/**
 * @param {string} s
 * @return {string[]}
 */
var cellsInRange = function (s) {
    const res = [];
    let xStart = s[0].charCodeAt() - 65;
    let xEnd = s[3].charCodeAt() - 65;
    let yStart = Number.parseInt(s[1]);
    let yEnd = Number.parseInt(s[4]);
    for (let i = xStart; i <= xEnd; i++) {
        for (let j = yStart; j <= yEnd; j++) {
            res.push(String.fromCharCode(i + 65) + j.toString());
        }
    }
    return res;
};
console.log(cellsInRange('A1:F1'));
console.log(cellsInRange('K1:L2'));
